<template>
  <div class="yxp-wordList-top">
    <div class="back" @click="handleBack">
      <span></span>
    </div>
    <div class="yxp-top-c" v-if="type === '1'">选择学习词库</div>
    <div class="yxp-top-c" v-else>{{title}}</div>
    <div class="yxp-top-r"></div>
  </div>
</template>
<script>
export default {
  name: 'TopBack',
  props: {
    title: {
      type: String,
      default: '选择学习词库'
    },
    id: {
      type: Number,
      default: 0
    },
    type: {
      type: String,
      default: '1'
    }
  },
  mounted () {
    console.log(this.title + '***---' + this.type)
  },
  data() {
    return {}
  },
  methods: {
    handleBack () {
      if (this.type === '1') {
        console.log(11111111111)
        this.$router.push({
          path: '/wordRemember',
          query: {
            package_id: this.id,
            title: this.title
          }
        })
      } else {
        console.log(2222222222)
        this.$router.push({
          path: '/wordRemember'
        })
      }
    }
  }
}
</script>
<style lang="less" scoped></style>
